home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 45
/
Aminet 45 (2001)(GTI - Schatztruhe)[!][Oct 2001].iso
/
Aminet
/
game
/
role
/
ldmud-3.2-bin.lha
/
mud
/
doc
/
efun
/
restore_object
< prev
next >
Wrap
Text File
|
2001-04-06
|
1KB
|
37 lines
SYNOPSIS
int restore_object (string name)
int restore_object (string str) (PRELIMINARY)
DESCRIPTION
Restore values of variables for current object from the file <name>,
or directly from the string <str>.
To restore directly from a string <str>, the string must begin
with the typical line "#x:y" as it is created by the save_object()
efun.
When restoring from a file, the name may end in ".c" which is stripped
off by the parser. The master object will probably append a .o to the
<name>. The validity of the filename is checked with a call to
check_valid_path().
Return 1 on success, 0 if there was nothing to restore.
Variables that has the type modifer 'nosave' will not be restored.
Example: nosave int xxx;
If inheritance is used, then it might be possible that a variable
will exist with the same name in more than one place. When
restoring, only one of these variables will be restored if
encountered in the save file.
A good practice is to have verbose and unique name on non-static
variables, which also will make it more easy to read or patch the
save file manually.
HISTORY
Restoring directly from a string was added in LDMud 3.2.8 and
may be moved in future into a separate efun.
SEE ALSO
save_object(E), restore_value(E), valid_read(M)